package com.kurancy.web.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.kurancy.domain.KurancyUser;

@Secured(value="ROLE_ADMIN")
@RequestMapping("/admin/**")
@Controller
public class AdminController {

	/** The logger. */
	private static Log logger = LogFactory.getLog(AdminController.class);

	@RequestMapping
    public String index(ModelMap map) {

    	long kurancyUsersCount = KurancyUser.countKurancyUsers();
    	map.addAttribute("admin.numberOfUsers", kurancyUsersCount);
		
        return "admin/index";
    }
}
